// 多继承 菱形继承
// 查看对象模型指令 cl /d1 reportSingleClassLayoutAlpaca "multiInherti.cpp"
#include <iostream>
using namespace std;
class Animal {
public:
    int m_age;
};
// 虚继承 (解决菱形继承问题)
class Sheep: virtual public Animal {};
class Camel: virtual public Animal {};
// 羊驼
class Alpaca: public Sheep, public Camel {};
void test1() {
    Alpaca a1;
    a1.Sheep::m_age = 10;
    a1.Camel::m_age = 20;
    cout << "a1.Sheep::m_age = " << a1.Sheep::m_age << endl;
    cout << "a1.Camel::m_age = " << a1.Camel::m_age << endl;
    cout << "a1.m_age = " << a1.m_age << endl;
}
int main(void) {
    test1();

    return 0;
}